<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const arr = [3, 5, 7, 9, 18]
        const arr1 = [3, 5, 7, 9, 18, 8, 6, 13, 18]
        // const arr1 = arr.filter(item => item !== 3 && item !== 9)
        // console.log(arr1);
        Array.prototype.guolv = function () {
            return this.filter(item => item == 3 || item == 9)
        }
        const res = arr.guolv()
        const res1 = arr1.guolv()
        console.log(res);
        console.log(res1);
    </script>
</body>

</html>